# 10230
# def test(num):
#     j=999 #记录0的位置
#     for i in num:
#         if num[i]==0:
#             j=i
#         else:
#             if j!=999:
#                 num[j]=num[i]
#                 j=999
# 01032
def test(nums):
    # i遍历数组
    # j 表示非0元素新的位置
    # 时间：2n
    # 空间：1
    if len(nums)==0:
        print("输入为空")
        return 0
    j=0
    for i in range(len(nums)):
        if nums[i]==0:
            # j=i
            pass
        else:
            nums[j]=nums[i]
            j=j+1
    for i in range(j,len(nums)):
        nums[i]=0
    prin

if __name__=="__main__":
    # Nums=[0,1,0,3,2]
    Nums = []
    test(Nums)
